﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPages_MasterPage : System.Web.UI.MasterPage
{
    SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString);
    SqlCommand com;
    protected void Page_Load(object sender, EventArgs e)
    {
        string user = Session["username"].ToString();
        //Response.Write(user);
        lblUsernameLogin.Text =  user;
        if (Session["username"] == "")
        {
            btnLogout.Visible = false;
            LinkButtonLogin.Visible = true;
            
        }
        else
        {
            LinkButtonLogin.Visible = false;
            

        }
    }

    protected void btnLogout_Click(object sender, EventArgs e)
    {
        Session["username"] = "";
        Response.Redirect("LoginForm.aspx");
    }
}
